﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_salesOrderInfo : OTS.AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        TestPurview(HttpContext.Current, OTS.enumSysRight.SalesOrderManager);

        DoPageBind();
    }
    private void DoPageBind()
    {
        string strOrderID = Request.QueryString["orderId"];
        if (null == strOrderID || "".Equals(strOrderID))
        {
            Response.Write("参数错误");
            Response.End();
        }
        if (!OTS.Common.Help.IsNumber(strOrderID))
        {
            Response.Redirect("参数错误");
            Response.End();
        }
        OTS.BLL.SaleOrderBLL bll = new OTS.BLL.SaleOrderBLL();
        OTS.Model.saleOrder model = bll.GetFullModelByID(int.Parse(strOrderID));
        if (model != null)
        {
            switch (model.status)
            { 
                case 0:
                    this.labStatus.Text = "未付款";
                    break;
                case 1:
                    this.labStatus.Text = "已付款";
                    break;
                case 2:
                    this.labStatus.Text = "已发货";
                    break;
            }
            this.labOrderNO.Text = model.orderNO;
            this.labAddress.Text = model.address;
            this.labConsignee.Text = model.consignee;
            this.labDateTime.Text = model.addTime;
            this.labExpress.Text = OTS.Common.Help.GetExpressNameById(model.expressID.ToString());
            this.labExpressNO.Text = model.expressNO;
            this.labPayInfo.Text = model.payInfo;
            this.labPayMethod.Text = model.payMethod;
            this.labPayTime.Text = model.payTime;
            this.labPhone.Text = model.phone;
            this.labPostCode.Text = model.postcode;
            this.labTotalMoney.Text = model.totalMoney.ToString();
            this.lalCusLoginName.Text = model.cusLoginName;
            for (int i = 0; i < model.list.Count; i++)
            {
                model.list[i].bigImg_pic = PictureProcessing.GetThumbURL(model.list[i].bigImg_pic);
                model.list[i].basicInformation_pic = PictureProcessing.GetThumbURL(model.list[i].basicInformation_pic);
            }
            this.Repeater1.DataSource = model.list;
            this.Repeater1.DataBind();
            
        }
    }
}
